const express = require('express'); 
const pool = require('../pool');
const router = express.Router();

router.post('/sub',(req,res,next)=>{
    let obj = req.body;
    console.log(obj);
    pool.query('insert into consult set?',[obj],(err,r)=>{
        if(err){
            return next(err);
        };
        res.send({code:200,msg:'提交成功'})
    })
})
router.get('/sub',(req,res,next)=>{
    let obj = req.obj;
    console.log(obj);
    pool.query('insert into consult set ?',[obj],(err,r)=>{
        if(err){
            return next(err);
        };
        res.send({code:200,msg:'提交成功'})
    })
})
module.exports = router;